package 集合.Map.Map中的常用方法.Test01;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

public class MapTest01 {
    public static void main(String[] args) {
        Map<Integer,String> m = new HashMap<>();
        m.put(1,"张三");
        m.put(2,"李四");
        m.put(3,"a");
        m.put(4,"b");
        m.put(5,"c");
        System.out.println(m.get(1));

        System.out.println(m.size());

        m.remove(5);
        System.out.println(m.size());

        System.out.println(m.containsKey(5));
        System.out.println(m.containsValue("b"));
        
        System.out.println("============================================");
        Collection<String> c = m.values();
        for(String s : c){
            System.out.println(s);
        }

        m.clear();
        System.out.println(m.size());

        System.out.println(m.isEmpty());
    }
}
